package com.edu.medicalpro.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

import com.edu.medicalpro.R;
import com.edu.medicalpro.bean.YIYuanJiesShao;
import com.edu.medicalpro.mvp.HomeContrace;
import com.edu.medicalpro.mvp.presenter.HomePresenter;

public class YiYuanInfoActivity extends AppCompatActivity implements HomeContrace.YiYuanJieShaoView{
    HomePresenter homePresenter;
    YIYuanJiesShao jiesShao;
    TextView textView;
    ImageView imageView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_yi_yuan_info);
        homePresenter = new HomePresenter(this);
        homePresenter.getYYJS();
        initView();
    }
    void initView(){
        imageView=findViewById(R.id.yi_yuan_img);
        textView=findViewById(R.id.yi_yuan_jie_shao);
    }


    @Override
    public void YiYuanJieShao(YIYuanJiesShao jiesShao) {
        this.jiesShao=jiesShao;
        if (jiesShao!=null){
            textView.setText(jiesShao.getIntro());
            imageView.setImageResource(R.mipmap.ic_launcher);
        }
    }
}